-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ServiceTalk async context propagation instrumentation #7241
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061895
Total [baseline] (8.554 s) : 0, 8553735
Agent [candidate] (1.062 s) : 0, 1061906
Total [candidate] (8.591 s) : 0, 8590870
section iast
Agent [baseline] (1.173 s) : 0, 1173448
Total [baseline] (9.027 s) : 0, 9027071
Agent [candidate] (1.179 s) : 0, 1178582
Total [candidate] (9.016 s) : 0, 9016290
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.169 s) : 0, 1168586
Total [baseline] (9.013 s) : 0, 9013041
Agent [candidate] (1.171 s) : 0, 1171403
Total [candidate] (8.982 s) : 0, 8981808
section iast_TELEMETRY_OFF
Agent [baseline] (1.166 s) : 0, 1165790
Total [baseline] (9.032 s) : 0, 9031684
Agent [candidate] (1.174 s) : 0, 1174355
Total [candidate] (9.018 s) : 0, 9018013
gantt
title insecure-bank - break down per module: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (664.832 ms) : 0, 664832
BytebuddyAgent [candidate] (664.898 ms) : 0, 664898
GlobalTracer [baseline] (304.345 ms) : 0, 304345
GlobalTracer [candidate] (304.455 ms) : 0, 304455
AppSec [baseline] (49.992 ms) : 0, 49992
AppSec [candidate] (49.873 ms) : 0, 49873
Remote Config [baseline] (716.295 µs) : 0, 716
Remote Config [candidate] (762.082 µs) : 0, 762
Telemetry [baseline] (7.616 ms) : 0, 7616
Telemetry [candidate] (7.63 ms) : 0, 7630
section iast
BytebuddyAgent [baseline] (781.557 ms) : 0, 781557
BytebuddyAgent [candidate] (786.472 ms) : 0, 786472
GlobalTracer [baseline] (294.925 ms) : 0, 294925
GlobalTracer [candidate] (295.536 ms) : 0, 295536
AppSec [baseline] (47.198 ms) : 0, 47198
AppSec [candidate] (47.318 ms) : 0, 47318
IAST [baseline] (28.189 ms) : 0, 28189
IAST [candidate] (26.589 ms) : 0, 26589
Remote Config [baseline] (579.375 µs) : 0, 579
Remote Config [candidate] (615.347 µs) : 0, 615
Telemetry [baseline] (7.737 ms) : 0, 7737
Telemetry [candidate] (8.7 ms) : 0, 8700
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (778.517 ms) : 0, 778517
BytebuddyAgent [candidate] (779.949 ms) : 0, 779949
GlobalTracer [baseline] (294.604 ms) : 0, 294604
GlobalTracer [candidate] (294.75 ms) : 0, 294750
AppSec [baseline] (47.173 ms) : 0, 47173
AppSec [candidate] (47.134 ms) : 0, 47134
IAST [baseline] (27.392 ms) : 0, 27392
IAST [candidate] (28.659 ms) : 0, 28659
Remote Config [baseline] (629.042 µs) : 0, 629
Remote Config [candidate] (623.999 µs) : 0, 624
Telemetry [baseline] (6.969 ms) : 0, 6969
Telemetry [candidate] (6.991 ms) : 0, 6991
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (777.915 ms) : 0, 777915
BytebuddyAgent [candidate] (783.597 ms) : 0, 783597
GlobalTracer [baseline] (294.566 ms) : 0, 294566
GlobalTracer [candidate] (295.335 ms) : 0, 295335
AppSec [baseline] (46.963 ms) : 0, 46963
AppSec [candidate] (46.884 ms) : 0, 46884
IAST [baseline] (24.776 ms) : 0, 24776
IAST [candidate] (26.11 ms) : 0, 26110
Remote Config [baseline] (601.723 µs) : 0, 602
Remote Config [candidate] (591.85 µs) : 0, 592
Telemetry [baseline] (7.649 ms) : 0, 7649
Telemetry [candidate] (8.463 ms) : 0, 8463
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066203
Total [baseline] (10.388 s) : 0, 10387610
Agent [candidate] (1.074 s) : 0, 1074049
Total [candidate] (10.381 s) : 0, 10381426
section appsec
Agent [baseline] (1.189 s) : 0, 1188518
Total [baseline] (10.499 s) : 0, 10499497
Agent [candidate] (1.191 s) : 0, 1191306
Total [candidate] (10.519 s) : 0, 10518747
section iast
Agent [baseline] (1.172 s) : 0, 1172262
Total [baseline] (10.784 s) : 0, 10783689
Agent [candidate] (1.169 s) : 0, 1169500
Total [candidate] (10.723 s) : 0, 10722994
section profiling
Agent [baseline] (1.273 s) : 0, 1273062
Total [baseline] (10.68 s) : 0, 10679755
Agent [candidate] (1.266 s) : 0, 1265558
Total [candidate] (10.658 s) : 0, 10658028
gantt
title petclinic - break down per module: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (667.813 ms) : 0, 667813
BytebuddyAgent [candidate] (672.534 ms) : 0, 672534
GlobalTracer [baseline] (305.421 ms) : 0, 305421
GlobalTracer [candidate] (308.023 ms) : 0, 308023
AppSec [baseline] (50.23 ms) : 0, 50230
AppSec [candidate] (50.341 ms) : 0, 50341
Remote Config [baseline] (857.798 µs) : 0, 858
Remote Config [candidate] (745.174 µs) : 0, 745
Telemetry [baseline] (7.468 ms) : 0, 7468
Telemetry [candidate] (7.677 ms) : 0, 7677
section appsec
BytebuddyAgent [baseline] (678.993 ms) : 0, 678993
BytebuddyAgent [candidate] (680.966 ms) : 0, 680966
GlobalTracer [baseline] (299.697 ms) : 0, 299697
GlobalTracer [candidate] (300.706 ms) : 0, 300706
AppSec [baseline] (154.105 ms) : 0, 154105
AppSec [candidate] (154.785 ms) : 0, 154785
Remote Config [baseline] (650.25 µs) : 0, 650
Remote Config [candidate] (654.87 µs) : 0, 655
Telemetry [baseline] (8.744 ms) : 0, 8744
Telemetry [candidate] (9.608 ms) : 0, 9608
IAST [baseline] (23.671 ms) : 0, 23671
IAST [candidate] (19.96 ms) : 0, 19960
section iast
BytebuddyAgent [baseline] (780.807 ms) : 0, 780807
BytebuddyAgent [candidate] (779.131 ms) : 0, 779131
GlobalTracer [baseline] (295.151 ms) : 0, 295151
GlobalTracer [candidate] (295.191 ms) : 0, 295191
AppSec [baseline] (46.968 ms) : 0, 46968
AppSec [candidate] (47.102 ms) : 0, 47102
Remote Config [baseline] (640.373 µs) : 0, 640
Remote Config [candidate] (612.035 µs) : 0, 612
Telemetry [baseline] (6.92 ms) : 0, 6920
Telemetry [candidate] (7.01 ms) : 0, 7010
IAST [baseline] (28.487 ms) : 0, 28487
IAST [candidate] (27.177 ms) : 0, 27177
section profiling
ProfilingAgent [baseline] (96.461 ms) : 0, 96461
ProfilingAgent [candidate] (96.77 ms) : 0, 96770
BytebuddyAgent [baseline] (668.404 ms) : 0, 668404
BytebuddyAgent [candidate] (663.296 ms) : 0, 663296
GlobalTracer [baseline] (391.011 ms) : 0, 391011
GlobalTracer [candidate] (388.61 ms) : 0, 388610
AppSec [baseline] (51.603 ms) : 0, 51603
AppSec [candidate] (51.827 ms) : 0, 51827
Remote Config [baseline] (665.085 µs) : 0, 665
Remote Config [candidate] (674.041 µs) : 0, 674
Telemetry [baseline] (7.462 ms) : 0, 7462
Telemetry [candidate] (7.401 ms) : 0, 7401
Profiling [baseline] (96.485 ms) : 0, 96485
Profiling [candidate] (96.795 ms) : 0, 96795
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section baseline
no_agent (1.338 ms) : 1319, 1357
. : milestone, 1338,
appsec (1.72 ms) : 1695, 1745
. : milestone, 1720,
appsec_no_iast (1.731 ms) : 1707, 1756
. : milestone, 1731,
iast (1.466 ms) : 1444, 1488
. : milestone, 1466,
profiling (1.508 ms) : 1484, 1532
. : milestone, 1508,
tracing (1.464 ms) : 1439, 1489
. : milestone, 1464,
section candidate
no_agent (1.355 ms) : 1335, 1375
. : milestone, 1355,
appsec (1.737 ms) : 1714, 1761
. : milestone, 1737,
appsec_no_iast (1.716 ms) : 1690, 1742
. : milestone, 1716,
iast (1.494 ms) : 1471, 1517
. : milestone, 1494,
profiling (1.524 ms) : 1498, 1549
. : milestone, 1524,
tracing (1.469 ms) : 1446, 1493
. : milestone, 1469,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section baseline
no_agent (366.822 µs) : 347, 386
. : milestone, 367,
iast (481.869 µs) : 461, 503
. : milestone, 482,
iast_FULL (554.572 µs) : 533, 576
. : milestone, 555,
iast_GLOBAL (509.538 µs) : 488, 531
. : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (480.509 µs) : 460, 501
. : milestone, 481,
iast_INACTIVE (455.34 µs) : 434, 476
. : milestone, 455,
iast_TELEMETRY_OFF (473.173 µs) : 452, 495
. : milestone, 473,
tracing (447.03 µs) : 426, 468
. : milestone, 447,
section candidate
no_agent (370.191 µs) : 350, 390
. : milestone, 370,
iast (482.162 µs) : 461, 503
. : milestone, 482,
iast_FULL (552.638 µs) : 531, 574
. : milestone, 553,
iast_GLOBAL (508.967 µs) : 487, 531
. : milestone, 509,
iast_HARDCODED_SECRET_DISABLED (490.144 µs) : 469, 511
. : milestone, 490,
iast_INACTIVE (460.297 µs) : 439, 482
. : milestone, 460,
iast_TELEMETRY_OFF (478.102 µs) : 457, 500
. : milestone, 478,
tracing (454.047 µs) : 434, 474
. : milestone, 454,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section baseline
no_agent (15.551 s) : 15551000, 15551000
. : milestone, 15551000,
appsec (15.302 s) : 15302000, 15302000
. : milestone, 15302000,
iast (19.127 s) : 19127000, 19127000
. : milestone, 19127000,
iast_GLOBAL (17.97 s) : 17970000, 17970000
. : milestone, 17970000,
profiling (15.887 s) : 15887000, 15887000
. : milestone, 15887000,
tracing (15.01 s) : 15010000, 15010000
. : milestone, 15010000,
section candidate
no_agent (14.98 s) : 14980000, 14980000
. : milestone, 14980000,
appsec (14.984 s) : 14984000, 14984000
. : milestone, 14984000,
iast (18.719 s) : 18719000, 18719000
. : milestone, 18719000,
iast_GLOBAL (17.871 s) : 17871000, 17871000
. : milestone, 17871000,
profiling (15.309 s) : 15309000, 15309000
. : milestone, 15309000,
tracing (15.102 s) : 15102000, 15102000
. : milestone, 15102000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
dateFormat X
axisFormat %s
section baseline
no_agent (1.464 ms) : 1453, 1476
. : milestone, 1464,
appsec (2.229 ms) : 2195, 2263
. : milestone, 2229,
iast (1.992 ms) : 1950, 2034
. : milestone, 1992,
iast_GLOBAL (2.027 ms) : 1985, 2068
. : milestone, 2027,
profiling (1.873 ms) : 1839, 1908
. : milestone, 1873,
tracing (1.842 ms) : 1810, 1874
. : milestone, 1842,
section candidate
no_agent (1.467 ms) : 1456, 1479
. : milestone, 1467,
appsec (2.247 ms) : 2210, 2283
. : milestone, 2247,
iast (1.996 ms) : 1953, 2039
. : milestone, 1996,
iast_GLOBAL (2.037 ms) : 1993, 2080
. : milestone, 2037,
profiling (1.878 ms) : 1842, 1914
. : milestone, 1878,
tracing (1.857 ms) : 1823, 1891
. : milestone, 1857,
|
028cdf2
to
90f8975
Compare
fb8a65f
to
d891109
Compare
|
||
testImplementation group: 'io.servicetalk', name: 'servicetalk-concurrent-api', version: '0.42.0' | ||
testImplementation group: 'io.servicetalk', name: 'servicetalk-context-api', version: '0.42.0' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add a latestDepTest
section to detect future incompatible versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
private static final class Construct { | ||
@Advice.OnMethodEnter(suppress = Throwable.class) | ||
public static boolean enter(@Advice.Origin Class<?> clazz) { | ||
int level = CallDepthThreadLocalMap.incrementCallDepth(clazz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here the threadlocal is incremented but if the constructor throws there is no reset being done hence this advice will not work anymore for next calls. I do not think is possible to add onThrowable = Throwable.class to a constructor exit advice so perhaps we need another solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goal here to just associate the active span with the ContextMap
at the time it was created?
Looking at the code history CopyOnWriteContextMap
has always been a final class with a couple of constructors - you could decide to just instrument the constructor which takes an existing ContextMap
as that's the one the default constructor delegates to. There would be no nested calls there because you're only instrumenting the specific CopyOnWriteContextMap
type, so you could drop the entry advice and simplify the exit advice to always record the active span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
d891109
to
983e34d
Compare
983e34d
to
b30519d
Compare
What Does This Do
This is an instrumentation of the ServiceTalk framework, specifically targeting the concurrent module to enable asynchronous propagation of the Datadog tracing context.
It takes the existing parts of the ServiceTalk framework that aim to capture, preserve, and propagate context across asynchronous boundaries, and instruments them specifically for in-process asynchronous propagation of the Datadog context.
Motivation
A customer request to fix ServiceTalk in-process async context propagation.
Additional Notes
Jira ticket: AIDM-122
Supersedes #7188